package com.example.controller;
import io.micrometer.core.instrument.Counter;
import io.micrometer.core.instrument.MeterRegistry;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

    private final Counter helloCounter;

    public HelloController(MeterRegistry registry) {
        this.helloCounter = Counter.builder("hello_counter")
                .description("Hello Counter")
                .register(registry);
    }

    @GetMapping("/")
    public String hello() {
        helloCounter.increment();
        return "Hello, World!22222";
    }
}